package com.mc.book.service.impl;

import cn.hutool.captcha.CaptchaUtil;
import cn.hutool.captcha.CircleCaptcha;
import com.mc.book.dao.CommonDao;
import com.mc.book.dao.UserDao;
import com.mc.book.enums.ResponseEnum;
import com.mc.book.pojo.Result;
import com.mc.book.pojo.request.RequestCommonTitle;
import com.mc.book.pojo.request.RequestFeedBack;
import com.mc.book.pojo.request.RequestUser;
import com.mc.book.redis.RedisService;
import com.mc.book.service.CommonService;
import com.mc.book.service.UserService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
import java.util.concurrent.TimeUnit;

@Service
public class CommonServiceImpl implements CommonService {
	private static final Logger log = LoggerFactory.getLogger(CommonServiceImpl.class);

    @Autowired
    RedisService redis;

    @Autowired
    CommonDao commonDao;

    @Override
    public Result commonTitle() {
        RequestCommonTitle title = commonDao.getCommonTitle();
        return Result.success(title);
    }

    @Override
    public Result feedbackAdd(RequestFeedBack request) {
        Boolean add = commonDao.feedbackAdd(request);
        if(add)return Result.success();
        return Result.fail();
    }


}
